<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>流程控制语句</title>
</head>
<body>
<script>
    var bianhao = parseInt(prompt("您想加什么油？填写92或者97"));
    var sheng = parseFloat(prompt("您想加多少升？"));

    if (bianhao == 92) {
        if (sheng >= 20) {
            var price = sheng * 5.9;
        } else {
            var price = sheng * 6;
        }
    } else if (bianhao == 97) {
        if (sheng >= 30) {
            var price = sheng * 6.95;
        } else {
            var price = sheng * 7;
        }
    } else {
        alert("对不起，没有这个编号的汽油！");
    }

    alert("价格是" + price);

    //switch
    var num = 4;

    //switch判断语句
    switch (num) {
        case 1:
            console.log("星期一");
            break;
        case 2:
            console.log("星期二");
            break;
        case 3:
            console.log("星期三");
            break;
        case 4:
            console.log("星期四");
        //break;
        case 5:
            console.log("星期五");
        //break;
        case 6:
            console.log("星期六");
            break;
        case 7:
            console.log("星期日");
            break;
        default:
            console.log("你输入的数据有误");
            break;
    }
</script>
</body>
</html>